package com.bilgeadam.javaweb.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.bilgeadam.javaweb.model.Dog;

/**
 *
 * @author Bora SAYINER
 * @since Dec 27, 2014 5:29:01 PM
 * @version 1.0
 */
public class ApplicationContextListener implements ServletContextListener {

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		int count = 0;
		sce.getServletContext().setAttribute("count", count);
		// ServletContext servletContext = sce.getServletContext();
		// String name = servletContext.getInitParameter("dogName");
		// Dog dog = new Dog();
		// dog.setName(name);
		// servletContext.setAttribute("dog", dog);
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		System.out.println("contextDestroyed");
	}

}
